package org.hawk.gwtppc.webtest.tests.constructorsuite;

import java.util.List;

import org.hawk.gwtppc.webtest.common.Asserts;
import org.hawk.gwtppc.webtest.common.Test;
import org.hawk.gwtppc.webtest.tests.mock.ClassMock;
import org.hawk.gwtppc.webtest.tests.mock.EnumMock;
import org.hawk.gwtppc.webtest.tests.mock.GenericClassMock;
import org.hawk.gwtppc.webtest.tests.mock.SubClassMock1;
import org.hawk.gwtppc.webtest.tests.mock.SubClassMock2;

public class ToStringAndGenericStringTest implements Test {

	public void run() throws Throwable {
		Asserts.assertEquals(EnumMock.class.getDeclaredConstructor(String.class,int.class).toString(), "private org.hawk.gwtppc.webtest.tests.mock.EnumMock(java.lang.String,int)");
		Asserts.assertEquals(EnumMock.class.getDeclaredConstructor(String.class,int.class).toGenericString(), "private org.hawk.gwtppc.webtest.tests.mock.EnumMock(java.lang.String,int)");
		Asserts.assertEquals(ClassMock.class.getDeclaredConstructor().toString(), "public org.hawk.gwtppc.webtest.tests.mock.ClassMock()");
		Asserts.assertEquals(ClassMock.class.getDeclaredConstructor().toGenericString(), "public org.hawk.gwtppc.webtest.tests.mock.ClassMock()");
		Asserts.assertEquals(SubClassMock1.class.getDeclaredConstructor().toString(), "public org.hawk.gwtppc.webtest.tests.mock.SubClassMock1()");
		Asserts.assertEquals(SubClassMock1.class.getDeclaredConstructor().toGenericString(), "public org.hawk.gwtppc.webtest.tests.mock.SubClassMock1()");
		Asserts.assertEquals(SubClassMock2.class.getDeclaredConstructor(String.class).toString(), "public org.hawk.gwtppc.webtest.tests.mock.SubClassMock2(java.lang.String)");
		Asserts.assertEquals(SubClassMock2.class.getDeclaredConstructor(String.class).toGenericString(), "public org.hawk.gwtppc.webtest.tests.mock.SubClassMock2(java.lang.String)");
		Asserts.assertEquals(SubClassMock2.class.getDeclaredConstructor(int.class).toString(), "public org.hawk.gwtppc.webtest.tests.mock.SubClassMock2(int)");
		Asserts.assertEquals(SubClassMock2.class.getDeclaredConstructor(int.class).toGenericString(), "public org.hawk.gwtppc.webtest.tests.mock.SubClassMock2(int)");
		Asserts.assertEquals(SubClassMock2.class.getDeclaredConstructor(int.class).toString(), "public org.hawk.gwtppc.webtest.tests.mock.SubClassMock2(int)");
		Asserts.assertEquals(SubClassMock2.class.getDeclaredConstructor(int.class).toGenericString(), "public org.hawk.gwtppc.webtest.tests.mock.SubClassMock2(int)");
		Asserts.assertEquals(GenericClassMock.class.getDeclaredConstructor(List.class, CharSequence.class, Object.class, Object.class).toString(), 
				"protected org.hawk.gwtppc.webtest.tests.mock.GenericClassMock(java.util.List,java.lang.CharSequence,java.lang.Object,java.lang.Object)");
		Asserts.assertEquals(GenericClassMock.class.getDeclaredConstructor(List.class, CharSequence.class, Object.class, Object.class).toGenericString(), 
				"protected <J> org.hawk.gwtppc.webtest.tests.mock.GenericClassMock(J,X1,X2,X3)");
	}

	public String getName() {
		return "toString()";
	}

}
